package com.mattgiant.corP5e;

import processing.core.PImage;
import processing.core.PVector;

/** The basic interface to represent a Core Image filter.  The method 
 * variations that use an int type key are meant to be used with the 
 * set of standard keys defined as constants in CorP5rConstants
 * @author giantm
 *
 */
public interface CorP5eFilter {

	/** set a PImage object as a filter parameter **/
	public abstract void setValueForKey(String key, PImage value);

	/** set a PImage object as a filter parameter **/
	public abstract void setValueForKey(int key, PImage value);

	/** set a float as a filter parameter **/
	public abstract void setValueForKey(String key, float value);

	/** set a float as a filter parameter **/
	public abstract void setValueForKey(int key, float value);

	/** set value for key to a vect4**/
	public abstract void setVectorForKey(	String key, 
											float x, 
											float y, 
											float z,
											float w);

	/** set value for key to a vect3**/
	public abstract void setVectorForKey(	String key, 
											float x, 
											float y, 
											float z );
	
	/** set value for key to a vect2**/
	public abstract void setVectorForKey(	String key, 
											float x, 
											float y ); 
	
	/** set value for key to a vect4**/
	public abstract void setVectorForKey(	int key, 
											float x, 
											float y, 
											float z,
											float w);

	/** set value for key to a vect3**/
	public abstract void setVectorForKey(	int key, 
											float x, 
											float y, 
											float z );

	/** set value for key to a vect4**/
	public abstract void setVectorForKey(	int key, 
											float x, 
											float y ); 
	
	/* set a value for a key using a Processing vector object **/
	public abstract void setVectorForKey(	int key,
											PVector vector );
	/** set a value for a key using a Processing vector object **/
	public abstract void setVectorForKey(	String key, 
											PVector vector );
	
	/** set a value for a key using the provided color components, this
	 * all float version of setColorForKey should be used when colorMode
	 * in Processing has been set to a floating point model**/	
	public void setColorForKey(	int		key,
								float	r,
								float	g,
								float	b,
								float	a );

	/** set a value for a key using the provided color components, this
	 * all float version of setColorForKey should be used when colorMode
	 * in Processing has been set to a floating point model**/	
	public void setColorForKey(	String	key,
		  						float	r,
		  						float	g,
		  						float	b,
		  						float	a );
			
	/** set a value for a key using the provided color components, this
	 * all int version of setColorForKey should be used when colorMode
	 * in Processing has been set to a integer model**/	
	public void setColorForKey(	int		key,
								int		r,
								int		g,
								int		b,
								int		a );

	/** set a value for a key using the provided color components, this
	 * all int version of setColorForKey should be used when colorMode
	 * in Processing has been set to an integer model**/	
	public void setColorForKey(	String	key,
		  						int		r,
		  						int		g,
		  						int		b,
		  						int		a );
	
	/** get the value of a CIImage type property from a filter **/
	public abstract PImage getImageOutputValue(String key);

	/** apply the filter to the main sketch display **/
	public abstract void process();
	
	/** apply the filter to a PImage object. The input image is not
	 * changed, a new image is returned with the effect applied
	 * **/
	public abstract PImage process( PImage img );

}